<?php
include_once 'app/until/GFW_database.php';

define('BCRUMB_BREAK_1','Edit');
define('BCRUMB_BREAK_2','Del');


class Crumb {

	protected  $crumb;
	protected  $Crumb_Name = 'Dicki Media';

	function __construct($design,$limit = 1){
	    $count = 0;
	    $this->crumb = array('<a href="
	    					'.ConfigFile::Get('BASE_DIR').'
	    					">dicki.de</a>'
	                        );
        $whoiam = explode('/',$design->url);
        
            foreach ($whoiam as $key => $name){
                if($limit<= $count){
                    break;
                }else{
                    if($name == BCRUMB_BREAK_1 ||$name == BCRUMB_BREAK_2){
                        break;
                    }elseif(!empty($name)){
                        $url = ConfigFile::Get('BASE_DIR');
                        for ($i = 0; $i <= $key;$i++){
                            $url .= $whoiam[$i].'/';
                        }
                        array_push($this->crumb,'<a href="'.$url.'">'.$name.'</a>');  
                    }             
                }
                $count++;
            }
	}
	 function getCrumb(){
	     return $this->crumb;
	 }
	 function getCrumb_Name() {
	 	return $this->Crumb_Name;
	 }
}

?>